import torch

from network import Generator,Discriminator
import matplotlib.pyplot as plt
device = torch.device('cuda')
G = Generator(100)
G.load_state_dict(torch.load('./weight/cGan.pth'),strict=True)
G = G.to(device)
G.eval()
with torch.no_grad() :
    fixed_z = torch.randn([1, 100]).to(device)
    c = torch.tensor([0,0,0,0,0,0,0,0,1,0]).to(device)
    output = G(fixed_z,c.unsqueeze(0))
    img = output.squeeze(0).permute(1,2,0).cpu().numpy()
plt.imshow(img,cmap='gray')
plt.show()
print(img.shape)
